import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Long Health App',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: DefaultTabController(
        length: 4,
        child: Scaffold(
          appBar: AppBar(
            title: Text('Long Health App'),
            bottom: TabBar(
              tabs: [
                Tab(text: '中医药'),
                Tab(text: '长寿案例'),
                Tab(text: '养生'),
                Tab(text: '我的'),
              ],
            ),
          ),
          drawer: Drawer( // 添加左侧抽屉菜单
            child: ListView(
              padding: EdgeInsets.zero,
              children: <Widget>[
                DrawerHeader(
                  decoration: BoxDecoration(
                    color: Colors.blue,
                  ),
                  child: Text(
                    '中医院分类',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 24,
                    ),
                  ),
                ),
                ListTile(
                  title: Text('中医内科'),
                  onTap: () {
                    // 处理点击事件
                    Navigator.pop(context);
                  },
                ),
                ListTile(
                  title: Text('中医外科'),
                  onTap: () {
                    // 处理点击事件
                    Navigator.pop(context);
                  },
                ),
                ListTile(
                  title: Text('中医妇科'),
                  onTap: () {
                    // 处理点击事件
                    Navigator.pop(context);
                  },
                ),
                ListTile(
                  title: Text('中医儿科'),
                  onTap: () {
                    // 处理点击事件
                    Navigator.pop(context);
                  },
                ),
              ],
            ),
          ),
          body: TabBarView(
            children: [
              Center(child: Text('中医药')),
              Center(child: Text('长寿案例')),
              Center(child: Text('养生')),
              Center(child: Text('我的')),
            ],
          ),
        ),
      ),
    );
  }
}